﻿
namespace Trentacular.SharePoint.Deployment.Model
{
    public abstract class BaseFeature<TParent, TSelf> : IFeature<TParent, TSelf>
        where TParent : IFeatureContainer<TSelf, TParent>
        where TSelf : IFeature<TParent, TSelf>
    {
        
        #region IFeature<TParent,TSelf> Members

        public virtual TParent Parent { get; set; }

        #endregion

        #region IFeature Members

        IFeatureContainer IFeature.Parent
        {
            get { return Parent; }
        }

        public virtual FeatureDefinition Definition { get; set; }
        public virtual bool Activated { get; set; }

        #endregion
    }

    public class FarmFeature : BaseFeature<Farm, FarmFeature> { }
    public class WebApplicationFeature : BaseFeature<WebApplication, WebApplicationFeature> { }
    public class SiteFeature : BaseFeature<Site, SiteFeature> { }
    public class WebFeature : BaseFeature<Web, WebFeature> { }
}
